home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / SWDOS12 / TEXTPOS.ASM < prev    next >
Assembly Source File  |  1995-02-10  |  1KB  |  44 lines

  1. ;******************************************************************
  2. ;*                          TEXTPOS.ASM                           *
  3. ;*          Source file for SoftWeyr enhanced DOS toolbox         *
  4. ;*                           version 1.1                          *
  5. ;*                 Copyright (c) by SoftWeyr,1994                 *
  6. ;******************************************************************
  7. .MODEL TPASCAL
  8. include textrec.asm
  9. .code
  10. Public TextPos
  11. TextPos Proc far F:Dword
  12.     les di,F
  13.     cmp es:[DI].TextRec.Mode,FMClosed
  14.     jnz @@1
  15.     mov AX,0FFFFH
  16.     mov dx,ax
  17.     jmp short @@4
  18. @@1:mov AX,4201H 
  19.     mov BX,ES:[DI].TextRec.Handle
  20.     Sub CX,CX
  21.     Mov DX,CX
  22.     INT 21H
  23.     jnc @@2
  24.     mov AX,0FFFFH
  25.     mov dx,ax
  26.     jmp short @@4
  27.     ; {calculate the position of the logical file pointer}
  28. @@2: Cmp ES:[DI].TextRec.Mode, FMOutput 
  29.      JNZ @@3
  30.      Add AX,ES:[DI].TextRec.Bufpos
  31.      jnc @@4
  32.      Inc dx
  33.      jmp @@4
  34. @@3: cmp ES:[DI].TextRec.BufEnd,0
  35.      jz @@4
  36.      mov cx,ES:[DI].TextRec.BufEnd
  37.      sub cx,ES:[DI].textRec.Bufpos
  38.      sub ax,cx
  39.      jnc @@4
  40.      dec dx
  41. @@4: ret
  42.     endp
  43. end
  44.